package com.qf.controller;

import com.qf.service.MyClass;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class TestSpringFactory {

    public static void main(String[] args) {

        //1.创建spring的工厂对象
        ApplicationContext context = new ClassPathXmlApplicationContext("spring-context.xml");
        //2.利用工厂对象获得业务对象

        MyClass mc = (MyClass)context.getBean("mc");

        //3.调用业务对象的方法
        mc.show();
    }

}
